<template>
  <el-button type="primary">测试饿了么按钮</el-button>
  <el-button type="danger">测试饿了么按钮</el-button>
  <div> 应答数据:{{ result }} </div>
  <div> 应答数据:{{ rdata.data }} </div>
</template>

<script setup>
import { ref,reactive } from 'vue';
import { Api } from '../script/Api';

//响应式数据
const result = ref({});
//reactive不支持简单类型，比如字符串，数字，布尔值，对象，数组等
//好处是不需要value属性来获取/设置数据

const rdata = reactive({
data:{},


});

Api.get('/test/echo', { echo: '暴龙战士' }, (data) => {
  //赋值要通过value属性
  result.value = data;
  rdata.data = data;
});
</script>
